<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <h3>style样式</h3>
      <!-- :style也允许添加对象，key是css的属性，value是变量或者表达式 -->
      <p
        :style="{color: color, fontSize: size + 'px', transform: 'translateX(' + late + 'px)'}"
      >
        style
      </p>
      <button @click="fn">btn</button>
    </div>

    <script src="../Vue.js"></script>
    <script>
      new Vue({
        el: "#app",
        data: {
          color: "green",
          size: 20,
          late: 50,
        },
        methods: {
          fn() {
            this.size++;
          },
        },
      });
    </script>
  </body>
</html>
